package cn.com.nes.site.controller.workOrder;

import cn.com.nes.common.web.CommonResult;
import cn.com.nes.site.entity.vo.workOrder.AgentPushCtceDataVO;
import cn.com.nes.site.service.workOrder.AgentPushCtceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(tags = {"项目模块 - 安装工单管理 - 推送数据到清洁取暖"})
@Controller
@RequestMapping("/v2/order/agentPushCtce")
public class AgentPushCtceController {

    @Resource
    private AgentPushCtceService agentPushCtceService;

    @ApiOperation("推送数据（ope-->ctce）")
    @RequestMapping(value = "/agentPushCtceData", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<T> agentPushCtceData(@RequestBody @Validated AgentPushCtceDataVO vo) throws Exception {
        agentPushCtceService.agentPushCtceData(vo);
        return CommonResult.ok();
    }

  @ApiOperation("推送设备更新申报的数据")
    @RequestMapping(value = "/agentPushdEclareData", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<T> agentPushdEclareData(@RequestBody @Validated AgentPushCtceDataVO vo) throws Exception {
        agentPushCtceService.agentPushCtceData(vo);
        return CommonResult.ok();
    }
}
